{% extends "base.html" %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--外呼记录{% endblock %}

{% block panel_heading %}
  万屏时代OPC--外呼记录
{% endblock %}

{% block panel_body %}
    <form id="search-outbound-form" action="{{ url_for('outbound_bp.outbound_list') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.call_state, div_col=6, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.admin_nickname, div_col=6, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        {{ my_wtf_macros.form_field(form.call_time_begin, div_col=6, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.call_time_end, div_col=6, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-outbound-btn">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'outbound_bp.outbound_list', **url_kwargs) }}
    </div>
    {% endif %}

    <table id="outbound-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>外呼编号</th>
                <th>队列状态</th>
                <th>外呼状态</th>
                <th>外呼时间</th>
                <th>接听座席</th>
                <th>接听人昵称</th>
                <th>跟进备注</th>
            </tr>
        </thead>
        <tbody>
            {% for outbound in outbounds %}
            <tr>
                <td>{{ outbound.call_id }}</td>
                <td>{{ outbound.queue_state }}</td>
                <td>{{ outbound.call_state }}</td>
                <td>{{ outbound.call_time }}</td>
                <td>{{ outbound.agent_id }}</td>
                <td>{{ outbound.admin_nickname }}</td>
                <td>{{ outbound.remark }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'outbound_bp.outbound_list', **url_kwargs) }}
    </div>
    {% endif %}
{% endblock %}
